package com.demo.web_06;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet()
public class GreetingServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        if (true) {
            request.setAttribute("aa", "aaa");
            response.setContentType("text/plain;charset=utf-8");
            response.getWriter().println("你好，这里是自定义的Servlet响应信息。");

        } else {
            System.out.printf("aaaa");
        }
    }
}